﻿using System;
using System.Linq;

using Xunit;

namespace NConfigGenerator.Tests
{
    public sealed class ConfigTreeTests
    {
        [Fact]
        public void CreationTest()
        {
            ConfigTree tree = ConfigTree.Create("root");
            Assert.NotNull(tree);
            Assert.NotNull(tree.RootNode);
            Assert.Equal(tree.RootNode.Name, "root");
            Assert.Equal(tree.RootNode.AllChildren.Count(), 0);
            Assert.Equal(tree.RootNode.Attributes.Count, 0);

            Assert.Throws<ArgumentNullException>(() => ConfigTree.Create(null));
        }
    }
}